<script>
/*
 * @Author: Your name
 * @Date:   2020-06-23 22:43:02
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2020-07-25 19:17:52
 */
</script>
<template>
    <div id="cart">
      <nav-bar class="nav-bar">
        <div slot="center">购物车({{getCartLength}})</div>
      </nav-bar>
      <cart-list class="cart-list" :cart-list="getCartList"></cart-list>
      <bottom-bar :cart-list="getCartList"></bottom-bar>
    </div>
</template>
<script>
import NavBar from '../../components/common/navbar/NavBar.vue';
import scroll from '../../components/common/scoll/Scroll.vue';
import CartList from './childComps/CartList.vue';
import BottomBar from './childComps/BottomBar.vue';
export default {
  name: 'Cart',
  components: {
    NavBar,
    scroll,
    CartList,
    BottomBar
  },
  activated(){
    
  },
  computed: {
    getCartList(){
      return this.$store.getters.cartList;
    },
    getCartLength(){
      return this.$store.getters.cartCounts;
    }
  }
}
</script>
<style lang="css"> 
  #cart {
    /*position: relative;*/
    height: 100vh;
  }
  .nav-bar {
    background-color: var(--color-tint);
    font-weight: 700;
    color: #fff;
  }

  .cart-list {
    position: absolute;
    top: 44px;
    bottom: 49px;
    width: 100%;
  } 
</style>